HybridMail Technical - reminder
Updated: 08-06-2023 15:56

Reminder XML attachment

The Reminder attachment is used to perform actions at a certain point before or after a specified reference date. Typical actions include sending an SMS message, an email or re-sending a letter.

Schema

<mkzAttachment type="reminder">
	<onSubmit>
		<setReminder action="required-action" >
			<schedule scan|identifier offset="offset-from-the-reference-date/time">reference-date/time</schedule>
			<recipient scan|identifier >recipient-email-or-mobile</recipient>
			<content scan|identifier >path-to-body-file</content>
			<subject scan|identifier >subject line</subject>
			[<from scan|identifier >sender</from>]
			[<useNHSsecureEmail >true</useNHSsecureEmail>]
			<substitute subKey="@PLACEHOLDER@" scan|identifier >replacement-value</substitute>
		</setReminder>
	</onSubmit>
</mkzAttachment>

The XML can be only be executed during the OnSubmit phase.

 

The XML supports the following elements.

<setReminder>  Create a reminder for the letter currently being submitted The action attribute specifies the type of action to take when the reminder is triggered. The <setReminder> element acts as a wrapper for the enclosed elements which specify details of the reminder. There can be multiple instances of this element. Each one will create a separate reminder for the letter being processed.

The action attribute can be one of email, sms and smsIfEDocNotAccessed.

emailSend an email to the specified recipient
smsSend an SMS message to the specified recipient
smsIfEDocNotAccessedSend an SMS message to the specified recipient, but only if the letter is an EDocs message which has not yet been accessed when the reminder is triggered
postCopyIfEDocNotAccessedPost a paper copy of the letter to the original recipient, but only if the letter is an EDocs message which has not yet been accessed when the reminder is triggered

<schedule>  The reminder reference date/time. Typically this is the date/time that the letter was created or a date/time specified in the letter content e.g. an appointment. The offset attribute specifies the number of days before or after the reference that the reminder will actually trigger.

The offset attribute specifies the number of days offset from the reference that the reminder will trigger. Use +ve numbers for days after the reference and -ve numbers for days before the reference. Typically you would use +ve numbers when the reference is the date/time the letter was created, and -ve numbers if the reference is a future event scanned from the letter.

<recipient>  The recipient details. i.e. an email address or a mobile phone number (for SMS). Typically these would be scanned from the letter or obtained from a database query.

<content>  The path to a file containing the body text. This can be a text file or (for emails) an HTML file. The file can contain substitution variables.

The subject attribute specifies the subject line for the text or email.

<substitute>  This element replaces all instances of the placeholder within the email or SMS body text with the scanned element text.

All elements support the scan|identifier attributes except for <setReminder>.

 

Example

Create two reminders for a letter, the first to be sent 7 days after the letter and the second 1 day before the appointment.

<mkzAttachment type="reminder" > 
	<setIdentifier name="timeNow" letterValue="date" />
	<setIdentifier name="appointmentDate" scan="100,50,70,100" date="future" />
	<setIdentifier name="patientName" letterValue="recipient" />
	<setIdentifier name="mobile" scan="0,0,100,20" extract="mobile" />
	
	<setReminder action="sms" >
		<schedule identifier="timeNow" offset="+7"/>
		<recipient identifier="mobile"></recipient>
		<content>remindersmsbody1.txt</content>
		
		<substitute subKey="@APPT_DATE@" identifier="appointmentDate"></substitute>
		<substitute subKey="@NAME@" identifier="patientName"></substitute>
	</setReminder>
	
	<setReminder action="sms" >
		<schedule identifier="appointmentDate" offset="-1"/>
		<recipient identifier="mobile"></recipient>
		<content>remindersmsbody2.txt</content>
		
		<substitute subKey="@APPT_DATE@" identifier="appointmentDate"></substitute>
		<substitute subKey="@NAME@" identifier="patientName"></substitute>
	</setReminder>
</mkzAttachment>